package apiTest;

import java.util.Arrays;
import java.util.stream.IntStream;

public class test1 {
    public static void main(String[] args) {
//        test11();
//        sum();
        sum3();
    }

    private static void sum3() {
        int sum = IntStream.rangeClosed(1, 100)
                .filter(i -> i % 3 == 0)
                .sum();
        System.out.println(sum);
    }

    private static void sum() {
        int sum = IntStream.rangeClosed(1, 100).sum();
        System.out.println(sum);
    }

    private static void test11() {
        int[] a = {1, 2, 3, 4, 5};
        Arrays.stream(a).map(i ->i*i).forEach(System.out::println);
    }
}
